package service;

import dao.UserDao;
import dao.UserDaoImpl;
import pojo.User;

/**
 * @author: zen
 * @date: 2020/4/19
 * @Title: UserManagement
 * @Description: 管理用户操作
 */
public class UserManagement {

    private static UserDao userDao = new UserDaoImpl();

    /**
     * 调用Dao修改用户密码
     * @param user
     * @return
     */
    public static boolean adaptSecret(User user) {
        boolean flag = userDao.modifyPassByUser(user);
        return flag;
    }

    /**
     * 调用DAO修改用户资料
     * @param user
     * @return
     */
    public static boolean saveUserInfo(User user) {
        boolean flag = userDao.modifyInfoByUser(user);
        return flag;
    }

    /**
     * 调用DaoAPI检查用户昵称是否可用
     * @param name
     * @return
     */
    public static boolean availableName(String name) {
        boolean flag = userDao.isAvailableName(name);
        return flag;
    }

}
